<%@ page contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ include file="/WEB-INF/jsp/common/include/taglibs.jsp"%>
<script type="text/javascript">

$(document).ready(function(){

});

//목록 가져오기
function submitData(){

	$('#frm').ajaxSubmit({
		dataType : 'json', 
		beforeSerialize: function() {
		},
		beforeSubmit : function() {
		},
		success : function(data) {
// 			console.log(data);
// 			Object {sSamMsg: "1열 test", iSamUserCnt: 1, iAddFail: 0, iAddCnt: 0, sFailMsg: ""}
			if(data.iSamUserCnt==0 && data.iAddFail==0){
				alert("총 " +data.iAddCnt+"건 등록되었습니다" );
			}else{
				var msg = "총 " +data.iAddCnt+"건 등록되었습니다\n";
				msg += "중복 :  " +data.iSamUserCnt+"건 \n";
				msg += "중복데이터 :  " +data.sSamMsg+" \n";
				
				msg += "실패 :  " +data.iAddFail+"건 \n\n";
				msg += "실패데이터 :  " +data.sFailMsg+"건 \n";
				alert(msg);
			}
		}
	});
	
}

</script>
<form action="./importExcelPrc.do" id="frm" name="frmData" method="post" enctype="multipart/form-data">
<input name="adm_seq" type="hidden" value="${param.adm_seq }">
	파일 <input name="file" type="file" id="file">
</form>
<button onclick="javascript:submitData();">등록</button>
